package com.xxx.common;

import java.util.ArrayList;
import java.util.List;

import com.xxx.common.dto.StatusModel;

/**
 * @ClassName: Const 
 * @Description: 常量类
 */
public class Const { 
	
	/**
	 * 后台分页数
	 */
	public static final int PAGE_SIZE = 10;
	
	/**
	 * long默认值
	 */
	public static final long DEFAULT_LONG_VALUE = 9999L;
	
	/**
	 * long默认为空
	 */
	public static final long DEFAULT_LONG_NULL= 9999L;
	
	/**
	 * int默认为空
	 */
	public static final int DEFAULT_INT_NULL= -1111;
	
	/**
	 * 库存预警数量
	 */
	public static final int WARN_NUM = 100;
	
	/**
	 * 有序的封装集合，下标从0开始
	 * @param typenames 待封装的字符串集
	 * @return
	 */
	public static List<StatusModel> getStatusList(String... status){
		int len = status.length;
		if(status == null || len == 0){
			return null;
		}
		List<StatusModel> list = new ArrayList<StatusModel>();
		StatusModel model = null;
		for(int i=0; i<len; i++){
			model = new StatusModel(i, status[i]);
			list.add(model);
		}
		return list;
	}
	
	
}
